<template>
	<view :class="[primarySize()]">
		<view class="container bg-white">
			<view class="ptb35 plr30">
				<view class="m-ellipsis-l2 fs36 fwb col3 lh56">{{news.title}}</view>
				<view class="flex-box mt25">
					<view class="col9 fs24 flex-grow-1">更新时间: {{formatDatetime(news.updatetime,'yyyy-mm-dd hh:ii')}}</view>
					<view class="flex-box">
						<image src="@/static/public/icon_view.png" mode="widthFix" class="ico24"></image>
						<view class="pl5 col9 fs24">{{news.view_count}}</view>
					</view>
				</view>
				<view class="mt30 fs30 lh44">
					<!-- 富文本区域 -->
					<u-parse :content="news.content"></u-parse>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	const app = getApp();
	export default {
		data() {
			return {
				
				news: {}
			}
		},
		onReady() {
			uni.setNavigationBarColor({
				frontColor: '#ffffff',
				backgroundColor: this.primaryColor()
			})
		},
		/**
		* 生命周期函数--监听页面加载
		*/
		onLoad(options) {
			
		    let id = options.id, page = this;
		    this.$core.get({url: '/xilujob.news/detail/id/'+id,success:ret=>{
				ret.data.news.content = ret.data.news.content.replace(/\<img/g,'<img style="width:100%;height:auto;display:block;" ');
		      page.news = ret.data.news;
		    }});
		},
		methods: {

		}
	}
</script>

<style>

</style>